// 课程接口封装文件
import request from '@/utils/request' // 导入封装的请求函数

// 1、获取所有的广告位及其对应的广告接口
export const getAllAds = (params) => {
  return request({
    method: 'GET',
    url: '/front/ad/getAllAds',
    params
  })
}

// 2、分页查询课程信息接口
export const getQueryCourses = (data) => {
  return request({
    method: 'POST',
    url: '/boss/course/getQueryCourses',
    data: data
  })
}

// 3、获取已购课程接口
export const getPurchaseCourse = () => {
  return request({
    method: 'GET',
    url: '/front/course/getPurchaseCourse'
  })
}

// 4、获取课程详情接口
export const getCourseById = (params) => {
  return request({
    method: 'GET',
    url: '/front/course/getCourseById',
    params
  })
}

// 5、获取课程章节接口
export const getSectionAndLesson = (params) => {
  return request({
    method: 'GET',
    url: '/front/course/session/getSectionAndLesson',
    params
  })
}

// 6、根据 fileId 获取阿里云对应的视频播放信息接口
export const videoPlayInfo = (params) => {
  return request({
    method: 'GET',
    url: '/front/course/media/videoPlayInfo',
    params
  })
}
